/*编写user模块所有的请求接口地址*/
import instance from "@/http";

//  获取验证码
export  const  getCaptcha = ()=> instance.get('/user/captcha')

// 认证请求  userForm  默认json格式
export const login = (userForm)=>instance.post('/user/login',userForm)

// 用户分页数据
export const userPage = (params)=>instance.post("/user/page",params)

// 新增用户信息
export  const  addUser = (form)=>instance.post('/user/add',form)

// 编辑用户信息
export  const  editUser = (form)=>instance.put('/user/edit',form)

// 编辑用户状态
export const editUserState = (id,state)=>instance.put("/user/state/"+id+"/"+state);

// 删除用户信息   data` 是作为请求体被发送的数据
export const batchDelete = (ids)=>instance.delete('/user/batchDelete',{data:ids})


// 获取用户个人信息
export const  getPersonalInfo = ()=>instance.get('user/personalInfo')


// 编辑用户信息
export const  editPersonalInfo = (form)=>instance.put('/user/editPersonalInfo',form)

// 编辑个人密码
export const  editPersonalPassword = (params)=>instance.put('/user/editPersonalPassword',params)

// 重置密码
export const resetPassword = (id)=>instance.put("/user/resetPassword/"+id)


// 获取用户菜单   动态菜单
export const  userMenu = ()=>instance.get('/user/menu')

// 退出登录
export const userLogout = ()=>instance.get('/user/logout')